<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <button id="btn">按钮</button>
    <div id="div1">我是div</div>
</body>
<script>
    let btn = document.querySelector("#btn");
    let div1 = document.querySelector("#div1");

    // 使用type="module"，不能在使用标签事件属性的方式绑定事件，只能通过DOM对象来注册事件函数
    let promise = import("./07evnetsMethods.js");

    promise.then(({handleClick,handleMouseover}) => {
        // console.log("res =",res);
        btn.addEventListener("click",handleClick);
        div1.addEventListener("mouseover",handleMouseover);
    })



  





</script>

</html>